<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.util.*" %>
<%@ page import="java.text.*" %>
<%@ page import="cc.woori.mobile.bean.*" %>
<%@ page import="cc.woori.mobile.PMF" %>
<%@ page import="javax.jdo.*" %>
<%@ page import="com.google.appengine.api.datastore.*" %>

<%
String reqKey = request.getParameter("key");
Key key = KeyFactory.stringToKey(reqKey);
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");

PersistenceManager pm = PMF.get().getPersistenceManager();
ChurchServiceEntry2 entry = null;

try {
	entry = pm.getObjectById(ChurchServiceEntry2.class, key);
    
} finally {
    if (pm != null) {
	pm.close();
    }
}
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<form name="input" action="/admin/modify?mode=edit&key=<%=reqKey%>" method="post">
    <table>
      <tr>
        <td>설교제목</td>
        <td><input type="text" name="title" size="80" value="<%=entry.getTitle() %>"/></td>
      </tr>
      <tr>
        <td>본문말씀</td>
        <td><input type="text" name="verse" size="80" value="<%=entry.getVerse() %>"/></td>
      </tr>
      <tr>
        <td>설명</td>
        <td><TEXTAREA name="description" rows="5" cols="50"><%=entry.getDescription().getValue() %></TEXTAREA></td>
      </tr>
      <tr>
        <td>목사님 성함</td>
        <td><input type="text" name="pastorName" value="김양재"size="80" value="<%=entry.getPastor() %>"/></td>
      </tr>
      <tr>
        <td>설교 동영상 URL</td>
        <td><input type="text" name="videoUrl" size="80" value="<%=entry.getSvcVideoUrl()%>"/></td>
      </tr>
      <tr>
        <td>설교 오디오 URL</td>
        <td><input type="text" name="audioUrl" size="80" value="<%=entry.getSvcAudioUrl()%>"/></td>
      </tr>
      <tr>
        <td>날짜</td>
        <td><input type="text" name="date" size="80" value="<%=sdf.format(entry.getPublishDate())%>"/>(예. 20100719)</td>
      </tr>
      <tr>
      	<td><input type="submit" value="수정" /></td>
      </tr>
    </table>
    </form>
</body>
</html>